/*
 * Copyright 2011-2016 YueJi.com All right reserved. This software is the
 * confidential and proprietary information of YueJi.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with YueJi.com.
 */
package com.bops.web.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

import com.bops.biz.permission.Menu;
import com.bops.biz.permission.UserGrant;
import com.bops.dal.information.dataobject.NewsInfoDO;
import com.bops.dal.information.queryobject.NewsInfoQuery;
import com.bops.service.CommonServiceLocator;
import com.bops.service.NewsInfoService;
import com.bops.valve.webuser.BopsWebUser;
import com.yue.commons.seine.web.annotations.ControllerAction;
import com.yue.commons.seine.web.servlet.mvc.AbstractController;
import com.yue.commons.seine.web.servlet.result.View;
import com.yue.commons.seine.web.servlet.result.WebResult;
 
/**
 * 类InfoWidgetController.java的实现描述：TODO 类实现描述 
 */
public class InfoWidgetController extends AbstractController{
    private static Date startDate;

    private NewsInfoService newsService = CommonServiceLocator.getNewsService();
    /**
     * 头的登录
     * */
    @ControllerAction
    public WebResult pheader(Map<String, Object> model) throws Exception {
        BopsWebUser bopsWebUser = BopsWebUser.getCurrentUser();
        if (bopsWebUser!=null)
        {
            model.put("userName",bopsWebUser.getName());
        }
        return new View("/popeye/pheader.vm");
    }
    
    /**
     * 新闻
     * */
    @ControllerAction
    public WebResult sidebar1(Map<String, Object> model){
    	NewsInfoQuery query = new NewsInfoQuery();
    	List<NewsInfoDO> newsInfo = newsService.listNews(query);
    	model.put("newsInfo", newsInfo);
    	return new View("/popeye/sidebar1.vm");
    }
  
}
